package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

public class IsrDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream   fis  =new FileInputStream("osw.txt");
        InputStreamReader isr =  new InputStreamReader(fis, StandardCharsets.UTF_8);
        /**read()读取一个字符。返回值为Int类型，这个inter值的低16位有效  -1表示读到文件末尾了*/
        int d;
        while((d=isr.read())!=-1){
            System.out.println((char)d);
        }
        isr.close();
    }
}
